package com.jadcon.bedbreakfast.util;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class DbUtils {
	
	
	public static void close(Connection conn, Statement stmt, ResultSet rs){
		if (rs != null){
			try{rs.close();
			}
			catch (SQLException ignore){}
		}
		if (stmt !=null){
			try{stmt.close();
			}
			catch (SQLException ignore){}
			}
		
		if (conn != null) {
			try{conn.close();
			}
			catch (SQLException ignore){}
		}
	}


public static void convertCheckedExceptionToRuntime(Exception e){
	e.printStackTrace();
	throw new RuntimeException(e.getClass().getName() + " : " + e.getMessage());
	}
}

